package com.grj.parking.drools.controller;

import com.grj.parking.drools.a.ParkingFeeService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/fees")
@RequiredArgsConstructor
public class FeeController {

    private final ParkingFeeService parkingFeeService;

    @GetMapping
    public String getFee(Long lotId) {
        System.out.printf("查询 %s 的停车费成功%n", lotId);
        return parkingFeeService.calculateFee(lotId).toString();
    }
}
